/*
 * rule.h
 *
 *  Created on: 15/11/2012
 *      Author: cvan680
 */

#ifndef MFTG_RULE_H_
#define MFTG_RULE_H_

#include "nodelist.h"

using std::string;

namespace voreen{

class Rule{

public:
	Rule();
	Rule(string rule);
	bool fires(NodeList state);
	void printString();
	void print();

	NodeList getPredecessor();
	NodeList getSuccessor();

private:

	int id_;
	string rule_;

	NodeList predecessor_;
	string condition_;
	NodeList successor_;
	float probability_;

	string cleanup(string rule);



	std::vector<string> tokenize(string contents, string delimiter);
	string trimmer(string s);
};

}


#endif /* MFTG_RULE_H_ */
